<?php
namespace core;

class Bootstrap
{
	public static function Start()
	{
		$loader = require ROOT_PATH. '\vendor\autoload.php';
		
		$controller = 'Index';
		$action = 'index';
		if (isset($_SERVER['PATH_INFO'])) {
			$pathinfo = explode('/', trim($_SERVER['PATH_INFO'], '/'));
			if (empty($pathinfo[0]) == false) $controller = $pathinfo[0];
			if (empty($pathinfo[1]) == false) $action = $pathinfo[1];
		}
		define('CONTROLLER', $controller);
		define('ACTION', $action);
		$class = '\\app\\'. $controller;
		$Object = new $class();
		$Object->$action();
	}
}
